package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SendoutCompanyMapper;
import com.ruoyi.system.domain.SendoutCompany;
import com.ruoyi.system.service.ISendoutCompanyService;

/**
 * 供应商信息Service业务层处理
 * 
 * @author he
 * @date 2025-08-13
 */
@Service
public class SendoutCompanyServiceImpl implements ISendoutCompanyService 
{
    @Autowired
    private SendoutCompanyMapper sendoutCompanyMapper;

    /**
     * 查询供应商信息
     * 
     * @param id 供应商信息主键
     * @return 供应商信息
     */
    @Override
    public SendoutCompany selectSendoutCompanyById(Long id)
    {
        return sendoutCompanyMapper.selectSendoutCompanyById(id);
    }

    /**
     * 查询供应商信息列表
     * 
     * @param sendoutCompany 供应商信息
     * @return 供应商信息
     */
    @Override
    public List<SendoutCompany> selectSendoutCompanyList(SendoutCompany sendoutCompany)
    {
        return sendoutCompanyMapper.selectSendoutCompanyList(sendoutCompany);
    }

    /**
     * 新增供应商信息
     * 
     * @param sendoutCompany 供应商信息
     * @return 结果
     */
    @Override
    public int insertSendoutCompany(SendoutCompany sendoutCompany)
    {
    sendoutCompany.setCreateUserId(SecurityUtils.getUserId());
    sendoutCompany.setCreateUserName(SecurityUtils.getUsername());
        sendoutCompany.setCreateTime(DateUtils.getNowDate());
        return sendoutCompanyMapper.insertSendoutCompany(sendoutCompany);
    }

    /**
     * 修改供应商信息
     * 
     * @param sendoutCompany 供应商信息
     * @return 结果
     */
    @Override
    public int updateSendoutCompany(SendoutCompany sendoutCompany)
    {
        sendoutCompany.setUpdateTime(DateUtils.getNowDate());
    sendoutCompany.setUpdateUserId(SecurityUtils.getUserId());
    sendoutCompany.setUpdateUserName(SecurityUtils.getUsername());
        return sendoutCompanyMapper.updateSendoutCompany(sendoutCompany);
    }

    /**
     * 批量删除供应商信息
     * 
     * @param ids 需要删除的供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteSendoutCompanyByIds(Long[] ids)
    {
        return sendoutCompanyMapper.deleteSendoutCompanyByIds(ids);
    }

    /**
     * 删除供应商信息信息
     * 
     * @param id 供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteSendoutCompanyById(Long id)
    {
        return sendoutCompanyMapper.deleteSendoutCompanyById(id);
    }

    @Override
    public List<SendoutCompany> getSendOutCompanyInfoList(String paramName) {

        return sendoutCompanyMapper.getSendOutCompanyInfoList(paramName);
    }
}
